package com.wanna.common.net;

import java.io.Serializable;

/**
 * 用来维护每个线程的下载位置
 *
 * @author wanna
 * @since 2018-5-24
 */
public class Position implements Serializable {

    /**
     * 线程起始位置
     */
    private long startIndex;

    /**
     * 线程结束位置
     */
    private long endIndex;

    /**
     * 线程暂停位置
     */
    private long pauseIndex;

    /**
     * 记录下载量
     */
    private long downloadSize;

    public Position(long startIndex, long endIndex) {
        this.startIndex = startIndex;
        this.endIndex = endIndex;
    }

    public Position(long startIndex, long endIndex, long pauseIndex) {
        this.startIndex = startIndex;
        this.endIndex = endIndex;
        this.pauseIndex = pauseIndex;
    }

    public Position(long startIndex, long endIndex, long pauseIndex, long downloadSize) {
        this.startIndex = startIndex;
        this.endIndex = endIndex;
        this.pauseIndex = pauseIndex;
        this.downloadSize = downloadSize;
    }

    public long getStartIndex() {
        return startIndex;
    }

    public void setStartIndex(long startIndex) {
        this.startIndex = startIndex;
    }

    public long getEndIndex() {
        return endIndex;
    }

    public void setEndIndex(long endIndex) {
        this.endIndex = endIndex;
    }

    public long getPauseIndex() {
        return pauseIndex;
    }

    public void setPauseIndex(long pauseIndex) {
        this.pauseIndex = pauseIndex;
    }

    public long getDownloadSize() {
        return downloadSize;
    }

    public void setDownloadSize(long downloadSize) {
        this.downloadSize = downloadSize;
    }
}
